abstract class A {

  A() {
    System.out.println("Klassi A isendi loomine."); 
  }


  abstract void esimeneTeade();

  void teineTeade() {
    System.out.println("See on klass A.");
  }
}

class B extends A {

  void esimeneTeade() {
    System.out.println("See on klass B.");
  }
}

class DemoAbstract {

  public static void main(String[] args) {
    B b = new B();
    b.esimeneTeade();
    b.teineTeade();
    // A a = new A(); viga!
    A a = new B();
  }
}